<?php

# http://projects:8081/cdapp-2kt-api/api/global_parameter_set.php

include_once './_portal.php';

$type = isset($post) && isset($post->type) ? $post->type : null;
$name = isset($post) && isset($post->name) ? $post->name : null;
$value = isset($post) && isset($post->value) ? $post->value : null;

if ($name !== null && $value !== null) {
  if ($type == 'param') {
    output(save_param($name, $value));
    die();
  } elseif ($type == 'variable') {
    output(save_variable($name, $value));
    die();
  }
}
output(false);
die();